package com.example.server.controller;

import com.example.nacos.api.DeregisterServiceProxy;
import com.example.server.config.NacosConfigLocalCatch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DeregisterServiceController implements DeregisterServiceProxy {

    @Autowired
    private NacosConfigLocalCatch nacosConfigLocalCatch;

    @Override
    public String deregister(String status) {
        try {
            nacosConfigLocalCatch.deregisterInstance(status);
        } catch (Exception e) {
            return Boolean.FALSE.toString();
        }
        return Boolean.TRUE.toString();
    }

}
